package com.goddess.yeecolor.view;


import android.app.Activity;
import android.app.Dialog;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.LinearLayout;

import com.goddess.yeecolor.R;
import com.goddess.yeecolor.activity.MyAppClient;

/**
 *收藏dialog
 */
public class dialog_collect {

    private static Dialog mDialog;
    public static void init(Activity mActivity){
        View mView= LayoutInflater.from(MyAppClient.getInstance()).inflate(R.layout.dialog_collect,null);
        LinearLayout mLinear= (LinearLayout) mView.findViewById(R.id.LinearLayoutcollect);
        mDialog=new Dialog(mActivity,R.style.theme_dia);
        mDialog.setCancelable(true);

        mDialog.show();
        Window window=mDialog.getWindow();
        WindowManager.LayoutParams lp=window.getAttributes();
        //获取屏幕的宽高
        WindowManager manager = mActivity.getWindowManager();
        DisplayMetrics outMetrics = new DisplayMetrics();
        manager.getDefaultDisplay().getMetrics(outMetrics);
        lp.alpha=0.7f;
        lp.width=outMetrics.widthPixels/3;
        lp.height=outMetrics.heightPixels/3;
        window.setAttributes(lp);
        mDialog.setContentView(mView);

    }

}
